import React from 'react'
import { RightOutlined } from '@ant-design/icons';
import { useHistory } from 'react-router-dom'

import styled from './style.module.scss'

interface IProps {
  title:string,
  route:string
}

const LinkTitle : React.FC<IProps>= ({title,route})=>{

  const history = useHistory()

  const handleClick = ()=>{
    history.push(route)
  }

  return(
    <div className={styled.root} onClick={handleClick}>
      {title}
      <RightOutlined />
    </div>
  )
}

export default LinkTitle